/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.brucexx.assistx.search.reader;

import com.brucexx.assistx.util.StringUtil;
import java.io.BufferedReader;
import java.io.InputStream;
import java.io.InputStreamReader;

/**
 *
 * @author zhao.xiong
 */
public class TextReader implements FileReader {

    @Override
    public String getContent(InputStream fis) throws Exception {
        StringBuilder sb = new StringBuilder();
        BufferedReader br = new BufferedReader(new InputStreamReader(fis));
        String line = "";
        while ((line = br.readLine()) != null) {
            sb.append(StringUtil.filterTag(line)).append(LINE_END);
        }
        return sb.toString();
    }
}
